package test;

import java.io.IOException;  
import java.nio.channels.*;  
/** 
 * serverSelector 与特定协议间的通信的借口 
 * @author Qing 
 * 
 */  
public interface Protocol {  
    /** 
     * 接收socketchannel 
     * @param key 
     * @throws IOException 
     */  
    void handleAccept(SelectionKey key)throws IOException;  
    /** 
     * 从一个socketchannel读信息 
     * @param key 
     * @throws IOException 
     */  
    void handleRead(SelectionKey key)throws IOException;  
    /** 
     * 向socketchannel写入信息 
     * @param key 
     * @throws IOException 
     */  
    void handleWrite(SelectionKey key)throws IOException;  
  
}  